Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize my_endpoints with my_endpoint #715

Merged
merged 2 commits into from
Sep 11, 2020

Conversation

ldej
Copy link
Contributor

@ldej ldej commented Sep 10, 2020

While I was trying to manually go through the invite/request process via Swagger I used the /connections/{conn_id}/accept-request endpoint and added My URL endpoint which resulted in an error 500.

Creating connection response
    connection_id: db0b89aa-df4c-4ec7-a99d-f11c1bcb18df

2020-09-09 12:32:12,290 aries_cloudagent.core.dispatcher ERROR Handler error: connections_accept_request
Traceback (most recent call last):
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/routes.py", line 435, in connections_accept_request
    response = await connection_mgr.create_response(connection, my_endpoint)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/manager.py", line 488, in create_response
    my_info, connection.inbound_connection_id, my_endpoints
UnboundLocalError: local variable 'my_endpoints' referenced before assignment
2020-09-09 12:32:12,292 aries_cloudagent.admin.server ERROR Handler error with exception: local variable 'my_endpoints' referenced before assignment
2020-09-09 12:32:12,292 aiohttp.server ERROR Error handling request
Traceback (most recent call last):
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 146, in ready_middleware
    raise e
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 136, in ready_middleware
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 161, in debug_middleware
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp_apispec/middlewares.py", line 45, in validation_middleware
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 253, in apply_limiter
    return await task
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/routes.py", line 435, in connections_accept_request
    response = await connection_mgr.create_response(connection, my_endpoint)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/manager.py", line 488, in create_response
    my_info, connection.inbound_connection_id, my_endpoints
UnboundLocalError: local variable 'my_endpoints' referenced before assignment

@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2020

Codecov Report

Merging #715 into master will decrease coverage by 0.00%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master     #715      +/-   ##
==========================================
- Coverage   99.01%   99.00%   -0.01%     
==========================================
  Files         254      254              
  Lines       13698    13699       +1     
==========================================
  Hits        13563    13563              
- Misses        135      136       +1     

Copy link
Contributor

@sklump sklump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not ... else is a sign of overthinking, could you reverse this and then I'll merge it?

@ldej
Copy link
Contributor Author

ldej commented Sep 11, 2020

Sure, I also updated lines 294-301 as they have the same if statement.

@sklump sklump merged commit 9398c2d into openwallet-foundation:master Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants